﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Lapkin.Models.DataModels
{
    public class Cart
    {
        [Key]
        public Guid Id { get; set; }
        public DateTime OrderDate { get; set; }
        public Decimal Total { get; set; }

        public virtual User User { get; set; }
        public virtual ICollection<CartDetail> CartDetail { get; set; }
    }

    public class CartDetail
    {
        [Key]
        public Guid Id { get; set; }
        public int Quantity { get; set; }
        public Decimal UnitPrice { get; set; }


        public virtual Product Product { get; set; }
        public virtual Cart Cart { get; set; }
        public virtual ICollection<CartVariant> Variants { get; set; }
    }

    public class CartVariant
    {
        [Key]
        public Guid Id { get; set; }
        public String Name { get; set; }
        public String Value { get; set; }
        public Decimal Discount { get; set; }

        public CartDetail CartDetail { get; set; }
    }
}